/****** Object:  Stored Procedure dbo.CGO_GameGet    Script Date: Friday, March 04, 2011 ******/
IF EXISTS ( SELECT  *
            FROM    dbo.sysobjects
            WHERE   id = OBJECT_ID(N'dbo.CGO_GameGet')
                    AND OBJECTPROPERTY(id, N'IsProcedure') = 1 ) 
  DROP PROCEDURE dbo.CGO_GameGet
GO

/* -------------------------------------------------------------------------------------
/   GameGet
/  ------------------------------------------------------------------------------------- */
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

CREATE PROCEDURE dbo.CGO_GameGet
  --@PortalID INT ,
  @GameID INT
AS 
  SELECT  GameID ,
          PortalID ,
          PackageName ,
          Name ,
          Description ,
          ImageURL ,
          ImageType ,
          ImageWidth ,
          ImageHeight ,
          GameTabID ,
          Status ,
          Category ,
          ImageDisplay ,
          CreatedByID ,
          UC.Username AS CreateByUserName ,
          CreatedDate ,
          LastUpdatedID ,
          UU.Username AS LastUpdateUserName ,
          LastUpdateDate
  FROM    dbo.CGO_Game M
          LEFT JOIN dbo.Users UC ON M.CreatedByID = UC.UserID
          LEFT JOIN dbo.Users UU ON M.LastUpdatedID = UU.UserID
  WHERE   GameID = @GameID
          --AND PortalID = @PortalID
	
GO